<?php
/**
 * Created by PhpStorm.
 * User: fengyan
 * Date: 17-11-8
 * Time: 上午9:26
 */

namespace App\Repositories\Portal;

use App\Models;
class PageRepository extends PortalRepository
{
    public function __construct()
    {
        parent::__construct();
        $this->model = new Models\Portal\Page();
    }

    private static $instance;

    /**
     * 实现单例
     */
    public static function getInstance()
    {
        if (!(self::$instance instanceof self)) {
            self::$instance = new self();
        }

        return self::$instance;
    }

    /**
     * 声明实例模型
     * @param array $filter
     * @return \Illuminate\Database\Eloquent\Builder
     */
    public function getSelectModel(array $filter = []): \Illuminate\Database\Eloquent\Builder
    {
        $model = $this->model;

        $model = $model->where('deleted_at', null);

        return $model;
    }
}